package com.neo.push.client;

import com.neo.push.client.listner.PushClientListener;
import com.neo.push.core.AcceptPush;
import com.neo.push.core.RegisterMessage;

/**
 * Created by lock on 17-8-2.
 */
public class TestClient {

    public static void main(String[] args) throws Exception {
        PushClient client = new BasePushClient("localhost", 9090, 1, new PushClientListener() {

            public void connected(PushClient client) throws Exception {
                client.registerConnection(new RegisterMessage("test","test2"));
            }

            @Override
            public void closed(PushClient client) throws Exception {
                System.out.println(" system closed !");
            }

            public void receivedPush(AcceptPush text) {
                System.out.println(" received push text ===========================>"+text.getContent());
            }
        });
        client.connectServer();
    }

}
